﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Warhammer40K_Simulator.model
{
    public abstract class figure : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        protected void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        public abstract figure clone(); 
        public virtual void copy(figure f)
        {
            Name = f.Name;

            Weapons = new ObservableCollection<weapon>();

            foreach (weapon w in f.Weapons)
            {
                Weapons.Add(w.clone());
            }

            SpecialRules = new ObservableCollection<specialrule>();
            foreach (specialrule r in f.SpecialRules)
            {
                SpecialRules.Add(r.clone());
            }

        }

        public String Name { get; set; }
        public ObservableCollection<weapon> Weapons { get; set; }
        public ObservableCollection<specialrule> SpecialRules { get; set; }


    }
}
